package com.lyj.linearalgebra.post.service;

import java.sql.SQLException;
import java.util.List;

import javax.management.RuntimeErrorException;

import com.lyj.linearalgebra.post.dao.PostDao;
import com.lyj.linearalgebra.post.domain.Post;
import com.lyj.linearalgebra.post.domain.Posts;

public class PostService {

	private PostDao postDao = new PostDao();
	
	public void issue(Post form) {
		postDao.issue(form);
	}

	public List<Posts> findAll() {
		return postDao.findAll();
	}

	public List<Post> findByUid(String uid) {
		return postDao.findByUid(uid);
		
	}

	public Post findByPid(String pid) {
		return postDao.findByPid(pid);
		
	}

	public String findUsernameByPid(String pid) {

		try {
			return postDao.findUsernameByPid(pid);
		} catch (SQLException e) {
            throw new RuntimeException(e);
		}
	}

}
